package com.aisile.admin.controller.v1;

import com.aisile.admin.service.AdSensitiveService;
import com.aisile.apis.admin.AdChannelControllerApi;
import com.aisile.apis.admin.AdSensitiveControllerApi;
import com.aisile.model.admin.dtos.ChannelDto;
import com.aisile.model.admin.dtos.SensitiveDto;
import com.aisile.model.admin.pojos.AdChannel;
import com.aisile.model.admin.pojos.AdSensitive;
import com.aisile.model.common.dtos.ResponseResult;
import com.baomidou.mybatisplus.extension.api.R;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/sensitive")
public class AdSensitiveController implements AdSensitiveControllerApi {
    @Autowired
   private AdSensitiveService adSensitiveService;
    @PostMapping("/page")
    @Override
    public ResponseResult adSensitiveFindAll(SensitiveDto adSensitive) {
        return adSensitiveService.findAll(adSensitive);
    }



    @GetMapping("/findById/{id}")
    @Override
    public ResponseResult adSensitivefindById(@PathVariable int id) {
        return adSensitiveService.add(id);
    }


    @PutMapping("/update")
    @Override
    public ResponseResult adSensitiveupdate(@RequestBody AdSensitive adSensitive) {
        return adSensitiveService.update(adSensitive);
    }
    @DeleteMapping("/delete/{id}")
    @Override
    public ResponseResult adSensitivedelete(@PathVariable int id) {
        return adSensitiveService.delete(id);
    }
   @PostMapping("/delMany2")
    @Override
    public ResponseResult adSensitiveDeMay(List<Integer> list) {
        return adSensitiveService.delMany1(list);
    }

    @PostMapping("/save")
    @Override
    public ResponseResult adSensitivesave(@RequestBody AdSensitive adSensitive) {
        return adSensitiveService.save1(adSensitive);
    }
}
